#ifndef Shape_H
#define Shape_H

#include <QPainter>

class IShape
{
public:
	IShape(){}
	IShape(float h, float v);
	virtual ~IShape(){}
	virtual void draw(QPainter &, float fRatio) = 0;
	virtual void addPoint(QPoint pt1);
	virtual void setText(const QString &strText) {}
	virtual int size() const;
	virtual float realSize() const;

protected:
	QList<QPoint> m_listPt;
	QString m_strText;
	float m_fPixelPitchH;
	float m_fPixelPitchV;
};

class Oval : public IShape
{
public:
	void draw(QPainter &painter, float fRatio);
};

class Rect : public IShape
{
public:
	void draw(QPainter &painter, float fRatio);
};

class Line : public IShape
{
public:
	void draw(QPainter &painter, float fRatio);
};

class Pen : public IShape
{
public:
	void draw(QPainter &painter, float fRatio);
	void addPoint(QPoint pt1);
	int size() const;

private:
	const QPolygonF makePolygon(float fRatio) const;
};

class Text : public IShape
{
public:
	void draw(QPainter &painter, float fRatio);
	void addPoint(QPoint pt1);
	void setText(const QString &strText);
	int size() const;
};

class Length : public Line
{
public:
	Length(float h, float v) { m_fPixelPitchH = h; m_fPixelPitchV = v; }
	void draw(QPainter &painter, float fRatio);
};

class Profile : public Length
{
public:
	Profile(float h, float v) : Length(h, v){}
	void draw(QPainter &painter, float fRatio);
	int size() const;
	const QList<QPoint> pointList();
};

class Position : public IShape
{
public:
	void draw(QPainter &painter, float fRatio);
	void addPoint(QPoint pt1);
	int size() const;
};

#endif // Shape_H
